<nav class="navbar-default navbar-static-side" role="navigation">
    <div class="nav-close"><i class="fa fa-times-circle"></i>
    </div>
    <div class="sidebar-collapse">
        <ul class="nav" id="side-menu">
            <li class="nav-header">
                <div class="dropdown profile-element">
<!--                    <span><img alt="image" class="img-circle" src="/static/admin/img/profile_small.jpg" /></span>-->
                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                               <span class="block m-t-xs"><strong class="font-bold"><?php echo $data['username'];?></strong></span>
                                <span class="text-muted text-xs block"><?php echo $data['role'];?><!--<b class="caret"></b>--></span>
                                </span>
                    </a>
                    <!--<ul class="dropdown-menu animated fadeInRight m-t-xs">
                        <li><a class="J_menuItem" href="form_avatar.html">修改头像</a>
                        </li>
                        <li><a class="J_menuItem" href="profile.html">个人资料</a>
                        </li>
                        <li><a class="J_menuItem" href="contacts.html">联系我们</a>
                        </li>
                        <li><a class="J_menuItem" href="mailbox.html">信箱</a>
                        </li>
                        <li class="divider"></li>
                        <li><a target="_self" href="/admin/login/logout">安全退出</a>
                        </li>
                    </ul>-->
                </div>
                <div class="logo-element">BS
                </div>
            </li>
            <?php foreach ($menu as $index => $value) {?>
                <?php if ($value['level']==1){ ?>
                    <li>
                    <a href="#">
                        <i class="<?php echo $value['icon'];?>"></i>
                        <span class="nav-label"><?php echo $value['title']?></span>
                        <span class="fa arrow"></span>
                    </a>
                        <ul class="nav nav-second-level">
                        <?php foreach ($menu as $item) {
                            if ($item['level'] ==2 && $item['typeid']== $value['id']){
                            ?>
                            <li>
                                <a class="J_menuItem" href="/<?php echo $item['name']?>" data-index="0"><?php echo $item['title']?></a>
                            </li>

                        <?php }}?>
                        </ul>
                    </li>
                <?php }?>
            <?php }?>
        </ul>
    </div>
</nav>